{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "2fb395c0-c5bf-4be4-82dd-509d68f549ca",
   "metadata": {},
   "source": [
    "# Pandas"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "882f1d05-8520-47d9-aaca-8da65a9a0eac",
   "metadata": {},
   "source": [
    "Panel DAS ->data analysis sofeware(system)\n",
    "\n",
    "DataFrame(数据帧)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "334be08b-0b8c-4e5f-8b7a-37736b5bff57",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "94f0889f-256d-4671-b96c-15842c3f41bb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 60,  70,  65, 100, 230, 150, 100, 300, 250, 150])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 时间4点，5点，... 22点\n",
    "times = np.array([6, 7, 8, 11, 12, 13, 18, 19, 20, 21])\n",
    "# 顾客人数\n",
    "customers = np.array([60, 70, 65, 100, 230, 150, 100, 300, 250, 150])\n",
    "customers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "7ead2a69-c63e-42df-959e-7535305d0967",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "60"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "customers[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "8287370e-3630-4fb3-85ad-515a8e55d4d3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x2d391ff72c0>]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoA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ij4+P2L9/f/Gzzz6TruBOutXzLS4uFh955BExJiZG9PHxEXv27Cm+8cYbotlslrbwDrrR63Pt2rW2Y9ztPet2CKIoig5NQERERETtxDkoREREJDsMKERERCQ7DChEREQkOwwoREREJDsMKERERCQ7DChEREQkOwwoREREJDsMKERERCQ7DChEREQkOwwoREREJDsMKERERCQ7DChEREQkO/8fXw/FCjCmSK8AAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 绘制不同时段顾客人数的变化\n",
    "plt.plot(times, customers, '--')\n",
    "plt.plot(times, customers,\"*\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e75d50b8-5f08-4eb6-913d-c5914ecd25fd",
   "metadata": {},
   "source": [
    "- Series:序列\r\n",
    "- \n",
    "DataFram：数据帧；"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c2660f81-6f7f-4ee5-bda9-a3bd54319006",
   "metadata": {},
   "source": [
    "## Series"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "29c2f38f-b308-42bf-b8b9-9fc5f310b8fb",
   "metadata": {},
   "outputs": [],
   "source": [
    "customers1 = pd.Series([60, 70, 65, 100, 230, 150, 100, 300, 250, 150])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "362ea297-d9c8-4bbc-9df3-b3dc9c98bcca",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 60,  70,  65, 100, 230, 150, 100, 300, 250, 150], dtype=int64)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "customers1.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "a1562992-6333-41ca-ae93-da84eeb46d9f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RangeIndex(start=0, stop=10, step=1)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "customers1.index\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "1dec25ff-5ef6-42d0-9c0b-19e8383a0485",
   "metadata": {},
   "outputs": [],
   "source": [
    "customers2=pd.Series([60, 70, 65, 100, 230, 150, 100, 300, 250, 150],index=[6, 7, 8, 11, 12, 13, 18, 19, 20, 21])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "742d3833-087c-432b-b2c0-998928838d32",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "230"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "customers2[12]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "1b2ffe07-5488-4685-8f82-0672529a209c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "60"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "times = ['6h', '7h', '8h', '11h', '12h', '13h', '18h', '19h', '20h', '21h']\n",
    "customers3 = pd.Series([60, 70, 65, 100, 230, 150, 100, 300, 250, 150], index=times)\n",
    "customers3[\"6h\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e45868e9-8d34-43d6-9d3f-bc87c7c35ff8",
   "metadata": {},
   "source": [
    "上述可以改变索引index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "dbed6bf4-0eca-417e-bcdc-a20a36caac66",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Xuhui      200\n",
       "Pudong     180\n",
       "Jingan     210\n",
       "Sheshan    100\n",
       "dtype: int64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hotel2customer = {'Xuhui': 200, 'Pudong': 180, 'Jingan': 210, 'Sheshan': 100}\n",
    "customers4 = pd.Series(hotel2customer)\n",
    "customers4"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "427a5e55-e5a5-49bc-971a-f5438a7cd36a",
   "metadata": {},
   "source": [
    "下述支持另一种索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "a8f25f77-aa46-4887-b5fa-351193d12626",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "200"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "customers4.iloc[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2040ec63-ab08-4111-b4b8-0ba6b31f106f",
   "metadata": {},
   "source": [
    "## DataFram"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "c43a849f-c7b3-4295-a384-5d6d7f253833",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 时段4点，5点，... 22点\n",
    "times = np.array([6, 7, 8, 11, 12, 13, 18, 19, 20, 21])\n",
    "# 顾客人数\n",
    "customers = np.array([60, 70, 65, 100, 230, 150, 100, 300, 250, 150])\n",
    "# 平均消费\n",
    "costs = np.array([6, 7, 8, 24, 23, 26, 45, 55, 45, 40])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "b07d7e4e-92fb-4bf5-b5dc-2a70f5aa847d",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>customers</th>\n",
       "      <th>costs</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>60</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>70</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>65</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>100</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>230</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>150</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>100</td>\n",
       "      <td>45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>300</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>250</td>\n",
       "      <td>45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>150</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    customers  costs\n",
       "6          60      6\n",
       "7          70      7\n",
       "8          65      8\n",
       "11        100     24\n",
       "12        230     23\n",
       "13        150     26\n",
       "18        100     45\n",
       "19        300     55\n",
       "20        250     45\n",
       "21        150     40"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = {'customers': customers, 'costs': costs}\n",
    "df = pd.DataFrame(data, index=times)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "38b4a8cf-9ec1-4c08-9323-4369e9e2fcb2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "23"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"costs\"][12]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "27ad90d9-b26c-4e2a-ae67-db25fba38641",
   "metadata": {},
   "outputs": [],
   "source": [
    "a=np.random.normal(loc=80, scale=20, size=40).astype(np.int32)\n",
    "b=np.random.normal(loc=60, scale=30, size=40).astype(np.int32)\n",
    "c=np.random.normal(loc=70, scale=20, size=40).astype(np.int32)\n",
    "d=np.random.normal(loc=80, scale=10, size=40).astype(np.int32)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "18483bf2-0934-4161-8e5e-cc560255f585",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>语文</th>\n",
       "      <th>数学</th>\n",
       "      <th>英语</th>\n",
       "      <th>物理</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>66</td>\n",
       "      <td>56</td>\n",
       "      <td>53</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>71</td>\n",
       "      <td>114</td>\n",
       "      <td>68</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>97</td>\n",
       "      <td>106</td>\n",
       "      <td>72</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>93</td>\n",
       "      <td>118</td>\n",
       "      <td>50</td>\n",
       "      <td>92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>67</td>\n",
       "      <td>28</td>\n",
       "      <td>97</td>\n",
       "      <td>69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>74</td>\n",
       "      <td>95</td>\n",
       "      <td>94</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>92</td>\n",
       "      <td>74</td>\n",
       "      <td>62</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>83</td>\n",
       "      <td>107</td>\n",
       "      <td>76</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>67</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>71</td>\n",
       "      <td>65</td>\n",
       "      <td>68</td>\n",
       "      <td>97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>65</td>\n",
       "      <td>85</td>\n",
       "      <td>79</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>82</td>\n",
       "      <td>64</td>\n",
       "      <td>82</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>79</td>\n",
       "      <td>68</td>\n",
       "      <td>21</td>\n",
       "      <td>93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>80</td>\n",
       "      <td>83</td>\n",
       "      <td>76</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>99</td>\n",
       "      <td>128</td>\n",
       "      <td>91</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>94</td>\n",
       "      <td>39</td>\n",
       "      <td>99</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>100</td>\n",
       "      <td>22</td>\n",
       "      <td>42</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>76</td>\n",
       "      <td>68</td>\n",
       "      <td>82</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>77</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>84</td>\n",
       "      <td>80</td>\n",
       "      <td>83</td>\n",
       "      <td>106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>89</td>\n",
       "      <td>31</td>\n",
       "      <td>91</td>\n",
       "      <td>96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>99</td>\n",
       "      <td>56</td>\n",
       "      <td>46</td>\n",
       "      <td>67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>89</td>\n",
       "      <td>74</td>\n",
       "      <td>47</td>\n",
       "      <td>67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>68</td>\n",
       "      <td>98</td>\n",
       "      <td>65</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>108</td>\n",
       "      <td>-9</td>\n",
       "      <td>75</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>79</td>\n",
       "      <td>68</td>\n",
       "      <td>22</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>90</td>\n",
       "      <td>60</td>\n",
       "      <td>47</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>81</td>\n",
       "      <td>44</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>76</td>\n",
       "      <td>100</td>\n",
       "      <td>35</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>76</td>\n",
       "      <td>96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>73</td>\n",
       "      <td>44</td>\n",
       "      <td>82</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>54</td>\n",
       "      <td>95</td>\n",
       "      <td>73</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>100</td>\n",
       "      <td>76</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>74</td>\n",
       "      <td>99</td>\n",
       "      <td>71</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>81</td>\n",
       "      <td>46</td>\n",
       "      <td>76</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>87</td>\n",
       "      <td>31</td>\n",
       "      <td>90</td>\n",
       "      <td>115</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>72</td>\n",
       "      <td>84</td>\n",
       "      <td>71</td>\n",
       "      <td>91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>108</td>\n",
       "      <td>54</td>\n",
       "      <td>81</td>\n",
       "      <td>83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>62</td>\n",
       "      <td>75</td>\n",
       "      <td>39</td>\n",
       "      <td>83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>63</td>\n",
       "      <td>57</td>\n",
       "      <td>73</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     语文   数学  英语   物理\n",
       "0    66   56  53   95\n",
       "1    71  114  68   81\n",
       "2    97  106  72   62\n",
       "3    93  118  50   92\n",
       "4    67   28  97   69\n",
       "5    74   95  94   78\n",
       "6    92   74  62   74\n",
       "7    83  107  76   76\n",
       "8    72   46  67   81\n",
       "9    71   65  68   97\n",
       "10   65   85  79   60\n",
       "11   82   64  82   66\n",
       "12   79   68  21   93\n",
       "13   80   83  76   82\n",
       "14   99  128  91   77\n",
       "15   94   39  99   81\n",
       "16  100   22  42   98\n",
       "17   76   68  82   95\n",
       "18   78   12  77   79\n",
       "19   84   80  83  106\n",
       "20   89   31  91   96\n",
       "21   99   56  46   67\n",
       "22   89   74  47   67\n",
       "23   68   98  65   72\n",
       "24  108   -9  75   79\n",
       "25   79   68  22   85\n",
       "26   90   60  47   68\n",
       "27   81   44  71   78\n",
       "28   76  100  35   82\n",
       "29   30   17  76   96\n",
       "30   73   44  82   76\n",
       "31   54   95  73   72\n",
       "32  100   76  49   90\n",
       "33   74   99  71   90\n",
       "34   81   46  76   98\n",
       "35   87   31  90  115\n",
       "36   72   84  71   91\n",
       "37  108   54  81   83\n",
       "38   62   75  39   83\n",
       "39   63   57  73   90"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e={\"语文\":a,\"数学\":b,\"英语\":c,\"物理\":d}\n",
    "chenji= pd.DataFrame(e)\n",
    "chenji"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "fd41abf6-f17f-49ba-946b-d2302fc54524",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>30</th>\n",
       "      <th>31</th>\n",
       "      <th>32</th>\n",
       "      <th>33</th>\n",
       "      <th>34</th>\n",
       "      <th>35</th>\n",
       "      <th>36</th>\n",
       "      <th>37</th>\n",
       "      <th>38</th>\n",
       "      <th>39</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>66</td>\n",
       "      <td>71</td>\n",
       "      <td>97</td>\n",
       "      <td>93</td>\n",
       "      <td>67</td>\n",
       "      <td>74</td>\n",
       "      <td>92</td>\n",
       "      <td>83</td>\n",
       "      <td>72</td>\n",
       "      <td>71</td>\n",
       "      <td>...</td>\n",
       "      <td>73</td>\n",
       "      <td>54</td>\n",
       "      <td>100</td>\n",
       "      <td>74</td>\n",
       "      <td>81</td>\n",
       "      <td>87</td>\n",
       "      <td>72</td>\n",
       "      <td>108</td>\n",
       "      <td>62</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>56</td>\n",
       "      <td>114</td>\n",
       "      <td>106</td>\n",
       "      <td>118</td>\n",
       "      <td>28</td>\n",
       "      <td>95</td>\n",
       "      <td>74</td>\n",
       "      <td>107</td>\n",
       "      <td>46</td>\n",
       "      <td>65</td>\n",
       "      <td>...</td>\n",
       "      <td>44</td>\n",
       "      <td>95</td>\n",
       "      <td>76</td>\n",
       "      <td>99</td>\n",
       "      <td>46</td>\n",
       "      <td>31</td>\n",
       "      <td>84</td>\n",
       "      <td>54</td>\n",
       "      <td>75</td>\n",
       "      <td>57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>53</td>\n",
       "      <td>68</td>\n",
       "      <td>72</td>\n",
       "      <td>50</td>\n",
       "      <td>97</td>\n",
       "      <td>94</td>\n",
       "      <td>62</td>\n",
       "      <td>76</td>\n",
       "      <td>67</td>\n",
       "      <td>68</td>\n",
       "      <td>...</td>\n",
       "      <td>82</td>\n",
       "      <td>73</td>\n",
       "      <td>49</td>\n",
       "      <td>71</td>\n",
       "      <td>76</td>\n",
       "      <td>90</td>\n",
       "      <td>71</td>\n",
       "      <td>81</td>\n",
       "      <td>39</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>95</td>\n",
       "      <td>81</td>\n",
       "      <td>62</td>\n",
       "      <td>92</td>\n",
       "      <td>69</td>\n",
       "      <td>78</td>\n",
       "      <td>74</td>\n",
       "      <td>76</td>\n",
       "      <td>81</td>\n",
       "      <td>97</td>\n",
       "      <td>...</td>\n",
       "      <td>76</td>\n",
       "      <td>72</td>\n",
       "      <td>90</td>\n",
       "      <td>90</td>\n",
       "      <td>98</td>\n",
       "      <td>115</td>\n",
       "      <td>91</td>\n",
       "      <td>83</td>\n",
       "      <td>83</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>4 rows × 40 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   0    1    2    3   4   5   6    7   8   9   ...  30  31   32  33  34   35  \\\n",
       "0  66   71   97   93  67  74  92   83  72  71  ...  73  54  100  74  81   87   \n",
       "1  56  114  106  118  28  95  74  107  46  65  ...  44  95   76  99  46   31   \n",
       "2  53   68   72   50  97  94  62   76  67  68  ...  82  73   49  71  76   90   \n",
       "3  95   81   62   92  69  78  74   76  81  97  ...  76  72   90  90  98  115   \n",
       "\n",
       "   36   37  38  39  \n",
       "0  72  108  62  63  \n",
       "1  84   54  75  57  \n",
       "2  71   81  39  73  \n",
       "3  91   83  83  90  \n",
       "\n",
       "[4 rows x 40 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g=[a,b,c,d]\n",
    "chenji1= pd.DataFrame(g)\n",
    "chenji1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "127dc333-6837-49da-80d2-684d69748454",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>语文</th>\n",
       "      <th>数学</th>\n",
       "      <th>英语</th>\n",
       "      <th>物理</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32219100001</th>\n",
       "      <td>66</td>\n",
       "      <td>56</td>\n",
       "      <td>53</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100002</th>\n",
       "      <td>71</td>\n",
       "      <td>114</td>\n",
       "      <td>68</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100003</th>\n",
       "      <td>97</td>\n",
       "      <td>106</td>\n",
       "      <td>72</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100004</th>\n",
       "      <td>93</td>\n",
       "      <td>118</td>\n",
       "      <td>50</td>\n",
       "      <td>92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100005</th>\n",
       "      <td>67</td>\n",
       "      <td>28</td>\n",
       "      <td>97</td>\n",
       "      <td>69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100006</th>\n",
       "      <td>74</td>\n",
       "      <td>95</td>\n",
       "      <td>94</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100007</th>\n",
       "      <td>92</td>\n",
       "      <td>74</td>\n",
       "      <td>62</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100008</th>\n",
       "      <td>83</td>\n",
       "      <td>107</td>\n",
       "      <td>76</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100009</th>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "      <td>67</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100010</th>\n",
       "      <td>71</td>\n",
       "      <td>65</td>\n",
       "      <td>68</td>\n",
       "      <td>97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100011</th>\n",
       "      <td>65</td>\n",
       "      <td>85</td>\n",
       "      <td>79</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100012</th>\n",
       "      <td>82</td>\n",
       "      <td>64</td>\n",
       "      <td>82</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100013</th>\n",
       "      <td>79</td>\n",
       "      <td>68</td>\n",
       "      <td>21</td>\n",
       "      <td>93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100014</th>\n",
       "      <td>80</td>\n",
       "      <td>83</td>\n",
       "      <td>76</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100015</th>\n",
       "      <td>99</td>\n",
       "      <td>128</td>\n",
       "      <td>91</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100016</th>\n",
       "      <td>94</td>\n",
       "      <td>39</td>\n",
       "      <td>99</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100017</th>\n",
       "      <td>100</td>\n",
       "      <td>22</td>\n",
       "      <td>42</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100018</th>\n",
       "      <td>76</td>\n",
       "      <td>68</td>\n",
       "      <td>82</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100019</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>77</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100020</th>\n",
       "      <td>84</td>\n",
       "      <td>80</td>\n",
       "      <td>83</td>\n",
       "      <td>106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100021</th>\n",
       "      <td>89</td>\n",
       "      <td>31</td>\n",
       "      <td>91</td>\n",
       "      <td>96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100022</th>\n",
       "      <td>99</td>\n",
       "      <td>56</td>\n",
       "      <td>46</td>\n",
       "      <td>67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100023</th>\n",
       "      <td>89</td>\n",
       "      <td>74</td>\n",
       "      <td>47</td>\n",
       "      <td>67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100024</th>\n",
       "      <td>68</td>\n",
       "      <td>98</td>\n",
       "      <td>65</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100025</th>\n",
       "      <td>108</td>\n",
       "      <td>-9</td>\n",
       "      <td>75</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100026</th>\n",
       "      <td>79</td>\n",
       "      <td>68</td>\n",
       "      <td>22</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100027</th>\n",
       "      <td>90</td>\n",
       "      <td>60</td>\n",
       "      <td>47</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100028</th>\n",
       "      <td>81</td>\n",
       "      <td>44</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100029</th>\n",
       "      <td>76</td>\n",
       "      <td>100</td>\n",
       "      <td>35</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100030</th>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>76</td>\n",
       "      <td>96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100031</th>\n",
       "      <td>73</td>\n",
       "      <td>44</td>\n",
       "      <td>82</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100032</th>\n",
       "      <td>54</td>\n",
       "      <td>95</td>\n",
       "      <td>73</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100033</th>\n",
       "      <td>100</td>\n",
       "      <td>76</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100034</th>\n",
       "      <td>74</td>\n",
       "      <td>99</td>\n",
       "      <td>71</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100035</th>\n",
       "      <td>81</td>\n",
       "      <td>46</td>\n",
       "      <td>76</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100036</th>\n",
       "      <td>87</td>\n",
       "      <td>31</td>\n",
       "      <td>90</td>\n",
       "      <td>115</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100037</th>\n",
       "      <td>72</td>\n",
       "      <td>84</td>\n",
       "      <td>71</td>\n",
       "      <td>91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100038</th>\n",
       "      <td>108</td>\n",
       "      <td>54</td>\n",
       "      <td>81</td>\n",
       "      <td>83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100039</th>\n",
       "      <td>62</td>\n",
       "      <td>75</td>\n",
       "      <td>39</td>\n",
       "      <td>83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100040</th>\n",
       "      <td>63</td>\n",
       "      <td>57</td>\n",
       "      <td>73</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              语文   数学  英语   物理\n",
       "32219100001   66   56  53   95\n",
       "32219100002   71  114  68   81\n",
       "32219100003   97  106  72   62\n",
       "32219100004   93  118  50   92\n",
       "32219100005   67   28  97   69\n",
       "32219100006   74   95  94   78\n",
       "32219100007   92   74  62   74\n",
       "32219100008   83  107  76   76\n",
       "32219100009   72   46  67   81\n",
       "32219100010   71   65  68   97\n",
       "32219100011   65   85  79   60\n",
       "32219100012   82   64  82   66\n",
       "32219100013   79   68  21   93\n",
       "32219100014   80   83  76   82\n",
       "32219100015   99  128  91   77\n",
       "32219100016   94   39  99   81\n",
       "32219100017  100   22  42   98\n",
       "32219100018   76   68  82   95\n",
       "32219100019   78   12  77   79\n",
       "32219100020   84   80  83  106\n",
       "32219100021   89   31  91   96\n",
       "32219100022   99   56  46   67\n",
       "32219100023   89   74  47   67\n",
       "32219100024   68   98  65   72\n",
       "32219100025  108   -9  75   79\n",
       "32219100026   79   68  22   85\n",
       "32219100027   90   60  47   68\n",
       "32219100028   81   44  71   78\n",
       "32219100029   76  100  35   82\n",
       "32219100030   30   17  76   96\n",
       "32219100031   73   44  82   76\n",
       "32219100032   54   95  73   72\n",
       "32219100033  100   76  49   90\n",
       "32219100034   74   99  71   90\n",
       "32219100035   81   46  76   98\n",
       "32219100036   87   31  90  115\n",
       "32219100037   72   84  71   91\n",
       "32219100038  108   54  81   83\n",
       "32219100039   62   75  39   83\n",
       "32219100040   63   57  73   90"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=[]\n",
    "for i in range(32219100001,32219100041):\n",
    "    a.append(i)\n",
    "chenji= pd.DataFrame(e,index=a)    \n",
    "chenji"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "8b3912c4-c44b-4506-a560-5f4bb541e9b7",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>语文</th>\n",
       "      <th>数学</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32219100001</th>\n",
       "      <td>66</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100002</th>\n",
       "      <td>71</td>\n",
       "      <td>114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100003</th>\n",
       "      <td>97</td>\n",
       "      <td>106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100004</th>\n",
       "      <td>93</td>\n",
       "      <td>118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100005</th>\n",
       "      <td>67</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100006</th>\n",
       "      <td>74</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100007</th>\n",
       "      <td>92</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100008</th>\n",
       "      <td>83</td>\n",
       "      <td>107</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100009</th>\n",
       "      <td>72</td>\n",
       "      <td>46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100010</th>\n",
       "      <td>71</td>\n",
       "      <td>65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100011</th>\n",
       "      <td>65</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100012</th>\n",
       "      <td>82</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100013</th>\n",
       "      <td>79</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100014</th>\n",
       "      <td>80</td>\n",
       "      <td>83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100015</th>\n",
       "      <td>99</td>\n",
       "      <td>128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100016</th>\n",
       "      <td>94</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100017</th>\n",
       "      <td>100</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100018</th>\n",
       "      <td>76</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100019</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100020</th>\n",
       "      <td>84</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100021</th>\n",
       "      <td>89</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100022</th>\n",
       "      <td>99</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100023</th>\n",
       "      <td>89</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100024</th>\n",
       "      <td>68</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100025</th>\n",
       "      <td>108</td>\n",
       "      <td>-9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100026</th>\n",
       "      <td>79</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100027</th>\n",
       "      <td>90</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100028</th>\n",
       "      <td>81</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100029</th>\n",
       "      <td>76</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100030</th>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100031</th>\n",
       "      <td>73</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100032</th>\n",
       "      <td>54</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100033</th>\n",
       "      <td>100</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100034</th>\n",
       "      <td>74</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100035</th>\n",
       "      <td>81</td>\n",
       "      <td>46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100036</th>\n",
       "      <td>87</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100037</th>\n",
       "      <td>72</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100038</th>\n",
       "      <td>108</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100039</th>\n",
       "      <td>62</td>\n",
       "      <td>75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100040</th>\n",
       "      <td>63</td>\n",
       "      <td>57</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              语文   数学\n",
       "32219100001   66   56\n",
       "32219100002   71  114\n",
       "32219100003   97  106\n",
       "32219100004   93  118\n",
       "32219100005   67   28\n",
       "32219100006   74   95\n",
       "32219100007   92   74\n",
       "32219100008   83  107\n",
       "32219100009   72   46\n",
       "32219100010   71   65\n",
       "32219100011   65   85\n",
       "32219100012   82   64\n",
       "32219100013   79   68\n",
       "32219100014   80   83\n",
       "32219100015   99  128\n",
       "32219100016   94   39\n",
       "32219100017  100   22\n",
       "32219100018   76   68\n",
       "32219100019   78   12\n",
       "32219100020   84   80\n",
       "32219100021   89   31\n",
       "32219100022   99   56\n",
       "32219100023   89   74\n",
       "32219100024   68   98\n",
       "32219100025  108   -9\n",
       "32219100026   79   68\n",
       "32219100027   90   60\n",
       "32219100028   81   44\n",
       "32219100029   76  100\n",
       "32219100030   30   17\n",
       "32219100031   73   44\n",
       "32219100032   54   95\n",
       "32219100033  100   76\n",
       "32219100034   74   99\n",
       "32219100035   81   46\n",
       "32219100036   87   31\n",
       "32219100037   72   84\n",
       "32219100038  108   54\n",
       "32219100039   62   75\n",
       "32219100040   63   57"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chenji[[\"语文\",\"数学\"]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "cbda100b-6eda-4414-ba94-f8ac3378a75f",
   "metadata": {},
   "outputs": [],
   "source": [
    "chenji.to_csv(\"score.csv\") #转文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3a6458e3-737e-44ec-9a68-134de8fadd55",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "65"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chenji[\"语文\"][32219100011]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "fa6fe187-cdfb-41cc-bf0e-1571e56d4070",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "65"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chenji.loc[32219100011][\"语文\"] #取行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "93936f71-7d84-4a79-be98-54d04376a991",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>语文</th>\n",
       "      <th>数学</th>\n",
       "      <th>英语</th>\n",
       "      <th>物理</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32219100003</th>\n",
       "      <td>97</td>\n",
       "      <td>106</td>\n",
       "      <td>72</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100004</th>\n",
       "      <td>93</td>\n",
       "      <td>118</td>\n",
       "      <td>50</td>\n",
       "      <td>92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100015</th>\n",
       "      <td>99</td>\n",
       "      <td>128</td>\n",
       "      <td>91</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             语文   数学  英语  物理\n",
       "32219100003  97  106  72  62\n",
       "32219100004  93  118  50  92\n",
       "32219100015  99  128  91  77"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chenji[(chenji[\"数学\"]>90)&(chenji[\"语文\"]>90)]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0716b2b0-5868-42f5-b2ef-1c0d615de383",
   "metadata": {},
   "source": [
    "# 作业"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fce3327d-fc41-4335-8bcd-66f7dbb1e8c0",
   "metadata": {},
   "source": [
    "- df.apply(func, axis=1)  : (func: 要应用的函数。axis=1: 指定操作沿着行进行。axis=0:对列操作)\n",
    "- lambda 参数: 表达式\n",
    "- 参数：这是传递给 lambda 函数的参数。\n",
    "- 表达式：这是 lambda 函数计算并返回的表达式。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "id": "3437c27e-5b4d-41b7-8720-0f2e7b89401e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0    12\n",
      "1    15\n",
      "2    18\n",
      "dtype: int64\n"
     ]
    }
   ],
   "source": [
    "# 例子\n",
    "import pandas as pd\n",
    "\n",
    "# 创建一个DataFrame\n",
    "df = pd.DataFrame({\n",
    "    'A': [1, 2, 3],\n",
    "    'B': [4, 5, 6],\n",
    "    'C': [7, 8, 9]\n",
    "})\n",
    "\n",
    "# 使用lambda函数计算每一行的和\n",
    "row_sums = df.apply(lambda row: row.sum(), axis=1)\n",
    "print(row_sums)\n",
    "\n",
    "##补充 mean()求平均"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d20387e3-ce1a-493b-9a60-3a94790c02c7",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "      <th>physics</th>\n",
       "      <th>Average_grade</th>\n",
       "      <th>total_score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32219100001</th>\n",
       "      <td>87.0</td>\n",
       "      <td>57.000</td>\n",
       "      <td>68.0</td>\n",
       "      <td>76.000</td>\n",
       "      <td>72.0000</td>\n",
       "      <td>288.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100002</th>\n",
       "      <td>63.0</td>\n",
       "      <td>66.000</td>\n",
       "      <td>52.0</td>\n",
       "      <td>95.000</td>\n",
       "      <td>69.0000</td>\n",
       "      <td>276.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100003</th>\n",
       "      <td>54.0</td>\n",
       "      <td>82.000</td>\n",
       "      <td>31.0</td>\n",
       "      <td>85.000</td>\n",
       "      <td>63.0000</td>\n",
       "      <td>252.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100004</th>\n",
       "      <td>111.0</td>\n",
       "      <td>39.000</td>\n",
       "      <td>81.0</td>\n",
       "      <td>87.000</td>\n",
       "      <td>79.5000</td>\n",
       "      <td>318.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100005</th>\n",
       "      <td>60.0</td>\n",
       "      <td>41.000</td>\n",
       "      <td>88.0</td>\n",
       "      <td>76.000</td>\n",
       "      <td>66.2500</td>\n",
       "      <td>265.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100006</th>\n",
       "      <td>75.0</td>\n",
       "      <td>95.000</td>\n",
       "      <td>60.0</td>\n",
       "      <td>93.000</td>\n",
       "      <td>80.7500</td>\n",
       "      <td>323.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100007</th>\n",
       "      <td>68.0</td>\n",
       "      <td>73.000</td>\n",
       "      <td>52.0</td>\n",
       "      <td>71.000</td>\n",
       "      <td>66.0000</td>\n",
       "      <td>264.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100008</th>\n",
       "      <td>71.0</td>\n",
       "      <td>57.000</td>\n",
       "      <td>58.0</td>\n",
       "      <td>57.000</td>\n",
       "      <td>60.7500</td>\n",
       "      <td>243.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100009</th>\n",
       "      <td>65.0</td>\n",
       "      <td>61.000</td>\n",
       "      <td>81.0</td>\n",
       "      <td>87.000</td>\n",
       "      <td>73.5000</td>\n",
       "      <td>294.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100010</th>\n",
       "      <td>109.0</td>\n",
       "      <td>87.000</td>\n",
       "      <td>60.0</td>\n",
       "      <td>91.000</td>\n",
       "      <td>86.7500</td>\n",
       "      <td>347.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100011</th>\n",
       "      <td>76.0</td>\n",
       "      <td>59.000</td>\n",
       "      <td>56.0</td>\n",
       "      <td>82.000</td>\n",
       "      <td>68.2500</td>\n",
       "      <td>273.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100012</th>\n",
       "      <td>46.0</td>\n",
       "      <td>98.000</td>\n",
       "      <td>79.0</td>\n",
       "      <td>68.000</td>\n",
       "      <td>72.7500</td>\n",
       "      <td>291.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100013</th>\n",
       "      <td>54.0</td>\n",
       "      <td>46.000</td>\n",
       "      <td>15.0</td>\n",
       "      <td>90.000</td>\n",
       "      <td>51.2500</td>\n",
       "      <td>205.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100014</th>\n",
       "      <td>69.0</td>\n",
       "      <td>60.000</td>\n",
       "      <td>57.0</td>\n",
       "      <td>83.000</td>\n",
       "      <td>67.2500</td>\n",
       "      <td>269.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100015</th>\n",
       "      <td>74.0</td>\n",
       "      <td>102.000</td>\n",
       "      <td>57.0</td>\n",
       "      <td>69.000</td>\n",
       "      <td>75.5000</td>\n",
       "      <td>302.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100016</th>\n",
       "      <td>49.0</td>\n",
       "      <td>72.000</td>\n",
       "      <td>40.0</td>\n",
       "      <td>75.000</td>\n",
       "      <td>59.0000</td>\n",
       "      <td>236.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100017</th>\n",
       "      <td>95.0</td>\n",
       "      <td>87.000</td>\n",
       "      <td>105.0</td>\n",
       "      <td>65.000</td>\n",
       "      <td>88.0000</td>\n",
       "      <td>352.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100018</th>\n",
       "      <td>69.0</td>\n",
       "      <td>70.000</td>\n",
       "      <td>75.0</td>\n",
       "      <td>83.000</td>\n",
       "      <td>74.2500</td>\n",
       "      <td>297.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100019</th>\n",
       "      <td>102.0</td>\n",
       "      <td>38.000</td>\n",
       "      <td>54.0</td>\n",
       "      <td>72.000</td>\n",
       "      <td>66.5000</td>\n",
       "      <td>266.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100020</th>\n",
       "      <td>98.0</td>\n",
       "      <td>41.000</td>\n",
       "      <td>85.0</td>\n",
       "      <td>87.000</td>\n",
       "      <td>77.7500</td>\n",
       "      <td>311.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100021</th>\n",
       "      <td>77.0</td>\n",
       "      <td>6.000</td>\n",
       "      <td>49.0</td>\n",
       "      <td>73.000</td>\n",
       "      <td>51.2500</td>\n",
       "      <td>205.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100022</th>\n",
       "      <td>97.0</td>\n",
       "      <td>60.000</td>\n",
       "      <td>68.0</td>\n",
       "      <td>95.000</td>\n",
       "      <td>80.0000</td>\n",
       "      <td>320.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100023</th>\n",
       "      <td>61.0</td>\n",
       "      <td>52.000</td>\n",
       "      <td>62.0</td>\n",
       "      <td>91.000</td>\n",
       "      <td>66.5000</td>\n",
       "      <td>266.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100024</th>\n",
       "      <td>103.0</td>\n",
       "      <td>30.000</td>\n",
       "      <td>86.0</td>\n",
       "      <td>86.000</td>\n",
       "      <td>76.2500</td>\n",
       "      <td>305.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100025</th>\n",
       "      <td>121.0</td>\n",
       "      <td>83.000</td>\n",
       "      <td>65.0</td>\n",
       "      <td>85.000</td>\n",
       "      <td>88.5000</td>\n",
       "      <td>354.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100026</th>\n",
       "      <td>61.0</td>\n",
       "      <td>93.000</td>\n",
       "      <td>72.0</td>\n",
       "      <td>70.000</td>\n",
       "      <td>74.0000</td>\n",
       "      <td>296.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100027</th>\n",
       "      <td>50.0</td>\n",
       "      <td>60.000</td>\n",
       "      <td>89.0</td>\n",
       "      <td>78.000</td>\n",
       "      <td>69.2500</td>\n",
       "      <td>277.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100028</th>\n",
       "      <td>97.0</td>\n",
       "      <td>65.000</td>\n",
       "      <td>143.0</td>\n",
       "      <td>73.000</td>\n",
       "      <td>94.5000</td>\n",
       "      <td>378.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100029</th>\n",
       "      <td>77.0</td>\n",
       "      <td>46.000</td>\n",
       "      <td>33.0</td>\n",
       "      <td>86.000</td>\n",
       "      <td>60.5000</td>\n",
       "      <td>242.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100030</th>\n",
       "      <td>99.0</td>\n",
       "      <td>56.000</td>\n",
       "      <td>70.0</td>\n",
       "      <td>85.000</td>\n",
       "      <td>77.5000</td>\n",
       "      <td>310.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100031</th>\n",
       "      <td>87.0</td>\n",
       "      <td>130.000</td>\n",
       "      <td>88.0</td>\n",
       "      <td>65.000</td>\n",
       "      <td>92.5000</td>\n",
       "      <td>370.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100032</th>\n",
       "      <td>67.0</td>\n",
       "      <td>56.000</td>\n",
       "      <td>77.0</td>\n",
       "      <td>61.000</td>\n",
       "      <td>65.2500</td>\n",
       "      <td>261.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100033</th>\n",
       "      <td>56.0</td>\n",
       "      <td>35.000</td>\n",
       "      <td>104.0</td>\n",
       "      <td>78.000</td>\n",
       "      <td>68.2500</td>\n",
       "      <td>273.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100034</th>\n",
       "      <td>99.0</td>\n",
       "      <td>80.000</td>\n",
       "      <td>54.0</td>\n",
       "      <td>76.000</td>\n",
       "      <td>77.2500</td>\n",
       "      <td>309.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100035</th>\n",
       "      <td>77.0</td>\n",
       "      <td>14.000</td>\n",
       "      <td>72.0</td>\n",
       "      <td>66.000</td>\n",
       "      <td>57.2500</td>\n",
       "      <td>229.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100036</th>\n",
       "      <td>90.0</td>\n",
       "      <td>55.000</td>\n",
       "      <td>47.0</td>\n",
       "      <td>82.000</td>\n",
       "      <td>68.5000</td>\n",
       "      <td>274.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100037</th>\n",
       "      <td>107.0</td>\n",
       "      <td>62.000</td>\n",
       "      <td>73.0</td>\n",
       "      <td>89.000</td>\n",
       "      <td>82.7500</td>\n",
       "      <td>331.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100038</th>\n",
       "      <td>87.0</td>\n",
       "      <td>12.000</td>\n",
       "      <td>93.0</td>\n",
       "      <td>71.000</td>\n",
       "      <td>65.7500</td>\n",
       "      <td>263.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100039</th>\n",
       "      <td>85.0</td>\n",
       "      <td>57.000</td>\n",
       "      <td>91.0</td>\n",
       "      <td>79.000</td>\n",
       "      <td>78.0000</td>\n",
       "      <td>312.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100040</th>\n",
       "      <td>99.0</td>\n",
       "      <td>112.000</td>\n",
       "      <td>102.0</td>\n",
       "      <td>78.000</td>\n",
       "      <td>97.7500</td>\n",
       "      <td>391.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Average_grade_per_course</th>\n",
       "      <td>79.8</td>\n",
       "      <td>62.375</td>\n",
       "      <td>69.8</td>\n",
       "      <td>78.975</td>\n",
       "      <td>72.7375</td>\n",
       "      <td>290.95</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                          Chinese     Math  English  physics  Average_grade  \\\n",
       "32219100001                  87.0   57.000     68.0   76.000        72.0000   \n",
       "32219100002                  63.0   66.000     52.0   95.000        69.0000   \n",
       "32219100003                  54.0   82.000     31.0   85.000        63.0000   \n",
       "32219100004                 111.0   39.000     81.0   87.000        79.5000   \n",
       "32219100005                  60.0   41.000     88.0   76.000        66.2500   \n",
       "32219100006                  75.0   95.000     60.0   93.000        80.7500   \n",
       "32219100007                  68.0   73.000     52.0   71.000        66.0000   \n",
       "32219100008                  71.0   57.000     58.0   57.000        60.7500   \n",
       "32219100009                  65.0   61.000     81.0   87.000        73.5000   \n",
       "32219100010                 109.0   87.000     60.0   91.000        86.7500   \n",
       "32219100011                  76.0   59.000     56.0   82.000        68.2500   \n",
       "32219100012                  46.0   98.000     79.0   68.000        72.7500   \n",
       "32219100013                  54.0   46.000     15.0   90.000        51.2500   \n",
       "32219100014                  69.0   60.000     57.0   83.000        67.2500   \n",
       "32219100015                  74.0  102.000     57.0   69.000        75.5000   \n",
       "32219100016                  49.0   72.000     40.0   75.000        59.0000   \n",
       "32219100017                  95.0   87.000    105.0   65.000        88.0000   \n",
       "32219100018                  69.0   70.000     75.0   83.000        74.2500   \n",
       "32219100019                 102.0   38.000     54.0   72.000        66.5000   \n",
       "32219100020                  98.0   41.000     85.0   87.000        77.7500   \n",
       "32219100021                  77.0    6.000     49.0   73.000        51.2500   \n",
       "32219100022                  97.0   60.000     68.0   95.000        80.0000   \n",
       "32219100023                  61.0   52.000     62.0   91.000        66.5000   \n",
       "32219100024                 103.0   30.000     86.0   86.000        76.2500   \n",
       "32219100025                 121.0   83.000     65.0   85.000        88.5000   \n",
       "32219100026                  61.0   93.000     72.0   70.000        74.0000   \n",
       "32219100027                  50.0   60.000     89.0   78.000        69.2500   \n",
       "32219100028                  97.0   65.000    143.0   73.000        94.5000   \n",
       "32219100029                  77.0   46.000     33.0   86.000        60.5000   \n",
       "32219100030                  99.0   56.000     70.0   85.000        77.5000   \n",
       "32219100031                  87.0  130.000     88.0   65.000        92.5000   \n",
       "32219100032                  67.0   56.000     77.0   61.000        65.2500   \n",
       "32219100033                  56.0   35.000    104.0   78.000        68.2500   \n",
       "32219100034                  99.0   80.000     54.0   76.000        77.2500   \n",
       "32219100035                  77.0   14.000     72.0   66.000        57.2500   \n",
       "32219100036                  90.0   55.000     47.0   82.000        68.5000   \n",
       "32219100037                 107.0   62.000     73.0   89.000        82.7500   \n",
       "32219100038                  87.0   12.000     93.0   71.000        65.7500   \n",
       "32219100039                  85.0   57.000     91.0   79.000        78.0000   \n",
       "32219100040                  99.0  112.000    102.0   78.000        97.7500   \n",
       "Average_grade_per_course     79.8   62.375     69.8   78.975        72.7375   \n",
       "\n",
       "                          total_score  \n",
       "32219100001                    288.00  \n",
       "32219100002                    276.00  \n",
       "32219100003                    252.00  \n",
       "32219100004                    318.00  \n",
       "32219100005                    265.00  \n",
       "32219100006                    323.00  \n",
       "32219100007                    264.00  \n",
       "32219100008                    243.00  \n",
       "32219100009                    294.00  \n",
       "32219100010                    347.00  \n",
       "32219100011                    273.00  \n",
       "32219100012                    291.00  \n",
       "32219100013                    205.00  \n",
       "32219100014                    269.00  \n",
       "32219100015                    302.00  \n",
       "32219100016                    236.00  \n",
       "32219100017                    352.00  \n",
       "32219100018                    297.00  \n",
       "32219100019                    266.00  \n",
       "32219100020                    311.00  \n",
       "32219100021                    205.00  \n",
       "32219100022                    320.00  \n",
       "32219100023                    266.00  \n",
       "32219100024                    305.00  \n",
       "32219100025                    354.00  \n",
       "32219100026                    296.00  \n",
       "32219100027                    277.00  \n",
       "32219100028                    378.00  \n",
       "32219100029                    242.00  \n",
       "32219100030                    310.00  \n",
       "32219100031                    370.00  \n",
       "32219100032                    261.00  \n",
       "32219100033                    273.00  \n",
       "32219100034                    309.00  \n",
       "32219100035                    229.00  \n",
       "32219100036                    274.00  \n",
       "32219100037                    331.00  \n",
       "32219100038                    263.00  \n",
       "32219100039                    312.00  \n",
       "32219100040                    391.00  \n",
       "Average_grade_per_course       290.95  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "a=np.random.normal(loc=80, scale=20, size=40).astype(np.int32)\n",
    "b=np.random.normal(loc=60, scale=30, size=40).astype(np.int32)\n",
    "c=np.random.normal(loc=70, scale=20, size=40).astype(np.int32)\n",
    "d=np.random.normal(loc=80, scale=10, size=40).astype(np.int32)\n",
    "e={\"Chinese\":a,\"Math\":b,\"English\":c,\"physics\":d}\n",
    "a=[]\n",
    "for i in range(32219100001,32219100041):\n",
    "    a.append(i)\n",
    "report_card= pd.DataFrame(e,index=a)\n",
    "report_card.loc[\"Average_grade_per_course\"]=report_card[[\"Chinese\",\"Math\",\"English\",\"physics\"]].mean(axis=0)\n",
    "report_card[\"Average_grade\"]=report_card[[\"Chinese\",\"Math\",\"English\",\"physics\"]].apply(lambda row: row.mean(), axis=1)\n",
    "report_card[\"total_score\"]=report_card[[\"Chinese\",\"Math\",\"English\",\"physics\"]].apply(lambda row: row.sum(), axis=1)\n",
    "report_card.to_csv(\"academic_performance.csv\")  ##内含平均成绩分析\n",
    "report_card_sorted1 = report_card.drop(\"Average_grade_per_course\")\n",
    "report_card_sorted2 =report_card_sorted1 .sort_values(by='total_score',ascending=False)\n",
    "report_card_sorted2.to_csv(\"Overall Score Ranking.csv\")  ##单纯以总分排名\n",
    "report_card"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "165e890a-3110-4c92-895a-4a421496ad6b",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "      <th>physics</th>\n",
       "      <th>Average_grade</th>\n",
       "      <th>total_score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32219100040</th>\n",
       "      <td>99.0</td>\n",
       "      <td>112.0</td>\n",
       "      <td>102.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>97.75</td>\n",
       "      <td>391.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100028</th>\n",
       "      <td>97.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>143.0</td>\n",
       "      <td>73.0</td>\n",
       "      <td>94.50</td>\n",
       "      <td>378.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100031</th>\n",
       "      <td>87.0</td>\n",
       "      <td>130.0</td>\n",
       "      <td>88.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>92.50</td>\n",
       "      <td>370.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100025</th>\n",
       "      <td>121.0</td>\n",
       "      <td>83.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>88.50</td>\n",
       "      <td>354.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100017</th>\n",
       "      <td>95.0</td>\n",
       "      <td>87.0</td>\n",
       "      <td>105.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>88.00</td>\n",
       "      <td>352.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100010</th>\n",
       "      <td>109.0</td>\n",
       "      <td>87.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>91.0</td>\n",
       "      <td>86.75</td>\n",
       "      <td>347.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100037</th>\n",
       "      <td>107.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>73.0</td>\n",
       "      <td>89.0</td>\n",
       "      <td>82.75</td>\n",
       "      <td>331.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100006</th>\n",
       "      <td>75.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>93.0</td>\n",
       "      <td>80.75</td>\n",
       "      <td>323.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100022</th>\n",
       "      <td>97.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>80.00</td>\n",
       "      <td>320.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100004</th>\n",
       "      <td>111.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>81.0</td>\n",
       "      <td>87.0</td>\n",
       "      <td>79.50</td>\n",
       "      <td>318.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100039</th>\n",
       "      <td>85.0</td>\n",
       "      <td>57.0</td>\n",
       "      <td>91.0</td>\n",
       "      <td>79.0</td>\n",
       "      <td>78.00</td>\n",
       "      <td>312.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100020</th>\n",
       "      <td>98.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>87.0</td>\n",
       "      <td>77.75</td>\n",
       "      <td>311.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100030</th>\n",
       "      <td>99.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>77.50</td>\n",
       "      <td>310.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100034</th>\n",
       "      <td>99.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>77.25</td>\n",
       "      <td>309.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100024</th>\n",
       "      <td>103.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>86.0</td>\n",
       "      <td>86.0</td>\n",
       "      <td>76.25</td>\n",
       "      <td>305.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100015</th>\n",
       "      <td>74.0</td>\n",
       "      <td>102.0</td>\n",
       "      <td>57.0</td>\n",
       "      <td>69.0</td>\n",
       "      <td>75.50</td>\n",
       "      <td>302.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100018</th>\n",
       "      <td>69.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>75.0</td>\n",
       "      <td>83.0</td>\n",
       "      <td>74.25</td>\n",
       "      <td>297.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100026</th>\n",
       "      <td>61.0</td>\n",
       "      <td>93.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>74.00</td>\n",
       "      <td>296.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100009</th>\n",
       "      <td>65.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>81.0</td>\n",
       "      <td>87.0</td>\n",
       "      <td>73.50</td>\n",
       "      <td>294.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100012</th>\n",
       "      <td>46.0</td>\n",
       "      <td>98.0</td>\n",
       "      <td>79.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>72.75</td>\n",
       "      <td>291.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100001</th>\n",
       "      <td>87.0</td>\n",
       "      <td>57.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>72.00</td>\n",
       "      <td>288.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100027</th>\n",
       "      <td>50.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>89.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>69.25</td>\n",
       "      <td>277.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100002</th>\n",
       "      <td>63.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>69.00</td>\n",
       "      <td>276.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100036</th>\n",
       "      <td>90.0</td>\n",
       "      <td>55.0</td>\n",
       "      <td>47.0</td>\n",
       "      <td>82.0</td>\n",
       "      <td>68.50</td>\n",
       "      <td>274.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100011</th>\n",
       "      <td>76.0</td>\n",
       "      <td>59.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>82.0</td>\n",
       "      <td>68.25</td>\n",
       "      <td>273.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100033</th>\n",
       "      <td>56.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>104.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>68.25</td>\n",
       "      <td>273.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100014</th>\n",
       "      <td>69.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>57.0</td>\n",
       "      <td>83.0</td>\n",
       "      <td>67.25</td>\n",
       "      <td>269.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100019</th>\n",
       "      <td>102.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>66.50</td>\n",
       "      <td>266.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100023</th>\n",
       "      <td>61.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>91.0</td>\n",
       "      <td>66.50</td>\n",
       "      <td>266.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100005</th>\n",
       "      <td>60.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>88.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>66.25</td>\n",
       "      <td>265.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100007</th>\n",
       "      <td>68.0</td>\n",
       "      <td>73.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>71.0</td>\n",
       "      <td>66.00</td>\n",
       "      <td>264.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100038</th>\n",
       "      <td>87.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>93.0</td>\n",
       "      <td>71.0</td>\n",
       "      <td>65.75</td>\n",
       "      <td>263.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100032</th>\n",
       "      <td>67.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>65.25</td>\n",
       "      <td>261.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100003</th>\n",
       "      <td>54.0</td>\n",
       "      <td>82.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>63.00</td>\n",
       "      <td>252.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100008</th>\n",
       "      <td>71.0</td>\n",
       "      <td>57.0</td>\n",
       "      <td>58.0</td>\n",
       "      <td>57.0</td>\n",
       "      <td>60.75</td>\n",
       "      <td>243.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100029</th>\n",
       "      <td>77.0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>86.0</td>\n",
       "      <td>60.50</td>\n",
       "      <td>242.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100016</th>\n",
       "      <td>49.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>75.0</td>\n",
       "      <td>59.00</td>\n",
       "      <td>236.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100035</th>\n",
       "      <td>77.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>57.25</td>\n",
       "      <td>229.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100013</th>\n",
       "      <td>54.0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>51.25</td>\n",
       "      <td>205.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100021</th>\n",
       "      <td>77.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>73.0</td>\n",
       "      <td>51.25</td>\n",
       "      <td>205.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Chinese   Math  English  physics  Average_grade  total_score\n",
       "32219100040     99.0  112.0    102.0     78.0          97.75        391.0\n",
       "32219100028     97.0   65.0    143.0     73.0          94.50        378.0\n",
       "32219100031     87.0  130.0     88.0     65.0          92.50        370.0\n",
       "32219100025    121.0   83.0     65.0     85.0          88.50        354.0\n",
       "32219100017     95.0   87.0    105.0     65.0          88.00        352.0\n",
       "32219100010    109.0   87.0     60.0     91.0          86.75        347.0\n",
       "32219100037    107.0   62.0     73.0     89.0          82.75        331.0\n",
       "32219100006     75.0   95.0     60.0     93.0          80.75        323.0\n",
       "32219100022     97.0   60.0     68.0     95.0          80.00        320.0\n",
       "32219100004    111.0   39.0     81.0     87.0          79.50        318.0\n",
       "32219100039     85.0   57.0     91.0     79.0          78.00        312.0\n",
       "32219100020     98.0   41.0     85.0     87.0          77.75        311.0\n",
       "32219100030     99.0   56.0     70.0     85.0          77.50        310.0\n",
       "32219100034     99.0   80.0     54.0     76.0          77.25        309.0\n",
       "32219100024    103.0   30.0     86.0     86.0          76.25        305.0\n",
       "32219100015     74.0  102.0     57.0     69.0          75.50        302.0\n",
       "32219100018     69.0   70.0     75.0     83.0          74.25        297.0\n",
       "32219100026     61.0   93.0     72.0     70.0          74.00        296.0\n",
       "32219100009     65.0   61.0     81.0     87.0          73.50        294.0\n",
       "32219100012     46.0   98.0     79.0     68.0          72.75        291.0\n",
       "32219100001     87.0   57.0     68.0     76.0          72.00        288.0\n",
       "32219100027     50.0   60.0     89.0     78.0          69.25        277.0\n",
       "32219100002     63.0   66.0     52.0     95.0          69.00        276.0\n",
       "32219100036     90.0   55.0     47.0     82.0          68.50        274.0\n",
       "32219100011     76.0   59.0     56.0     82.0          68.25        273.0\n",
       "32219100033     56.0   35.0    104.0     78.0          68.25        273.0\n",
       "32219100014     69.0   60.0     57.0     83.0          67.25        269.0\n",
       "32219100019    102.0   38.0     54.0     72.0          66.50        266.0\n",
       "32219100023     61.0   52.0     62.0     91.0          66.50        266.0\n",
       "32219100005     60.0   41.0     88.0     76.0          66.25        265.0\n",
       "32219100007     68.0   73.0     52.0     71.0          66.00        264.0\n",
       "32219100038     87.0   12.0     93.0     71.0          65.75        263.0\n",
       "32219100032     67.0   56.0     77.0     61.0          65.25        261.0\n",
       "32219100003     54.0   82.0     31.0     85.0          63.00        252.0\n",
       "32219100008     71.0   57.0     58.0     57.0          60.75        243.0\n",
       "32219100029     77.0   46.0     33.0     86.0          60.50        242.0\n",
       "32219100016     49.0   72.0     40.0     75.0          59.00        236.0\n",
       "32219100035     77.0   14.0     72.0     66.0          57.25        229.0\n",
       "32219100013     54.0   46.0     15.0     90.0          51.25        205.0\n",
       "32219100021     77.0    6.0     49.0     73.0          51.25        205.0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "report_card_sorted2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "078a17bf-b4df-43de-be5a-b25f6268993a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(report_card[[\"Chinese\",\"Math\",\"English\",\"physics\"]].mean(axis=0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9ed279fa-1349-4dcc-8def-bed5b5f21bda",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9a188ac2-9b74-4a08-91df-e708fa05356f",
   "metadata": {},
   "source": [
    "在Pandas中，.shape 属性返回一个元组，表示DataFrame的形状，即行数和列数。.shape[0] 就是这个元组的第一个元素，它代表DataFrame的行数。\n",
    "例如，如果你有一个DataFrame df，那么：df.shape[1]，即为列数"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "24d5f5d8-d892-44b8-825f-d39c26ea4337",
   "metadata": {},
   "source": [
    "### 法一:成绩分析报告"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "696f79cb-61d8-4000-be7a-d025697b31cb",
   "metadata": {},
   "outputs": [],
   "source": [
    "## passing_rate\n",
    "\n",
    "a=[report_card_sorted1[report_card_sorted1[\"Chinese\"]>=90].shape[0]/report_card_sorted1.shape[0]*100,report_card_sorted1[report_card_sorted1[\"Chinese\"]<90].shape[0],report_card_sorted1[(report_card_sorted1[\"Chinese\"]>=90)&(report_card_sorted1[\"Chinese\"]<120)].shape[0],report_card_sorted1[report_card_sorted1[\"Chinese\"]>=120].shape[0]]\n",
    "\n",
    "b=[report_card_sorted1[report_card_sorted1[\"Math\"]>=90].shape[0]/report_card_sorted1.shape[0]*100,report_card_sorted1[report_card_sorted1[\"Math\"]<90].shape[0],report_card_sorted1[(report_card_sorted1[\"Math\"]>=90)&(report_card_sorted1[\"Chinese\"]<120)].shape[0],report_card_sorted1[report_card_sorted1[\"Math\"]>=120].shape[0]]\n",
    "\n",
    "c=[report_card_sorted1[report_card_sorted1[\"English\"]>=90].shape[0]/report_card_sorted1.shape[0]*100,report_card_sorted1[report_card_sorted1[\"English\"]<90].shape[0],report_card_sorted1[(report_card_sorted1[\"English\"]>=90)&(report_card_sorted1[\"English\"]<120)].shape[0],report_card_sorted1[report_card_sorted1[\"English\"]>=120].shape[0]]\n",
    "\n",
    "d=[report_card_sorted1[report_card_sorted1[\"physics\"]>=60].shape[0]/report_card_sorted1.shape[0]*100,report_card_sorted1[report_card_sorted1[\"physics\"]<60].shape[0],report_card_sorted1[(report_card_sorted1[\"physics\"]>=60)&(report_card_sorted1[\"physics\"]<80)].shape[0],report_card_sorted1[report_card_sorted1[\"physics\"]>=80].shape[0]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "4f024835-b277-43e4-b148-4de8f6b824f5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "      <th>physics</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>passing_rate</th>\n",
       "      <td>35.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>97.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_&lt;60%_</th>\n",
       "      <td>26.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_60~80%_</th>\n",
       "      <td>13.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_80%~_</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              Chinese  Math  English  physics\n",
       "passing_rate     35.0  15.0     15.0     97.5\n",
       "_<60%_           26.0  34.0     34.0      1.0\n",
       "_60~80%_         13.0   6.0      5.0     20.0\n",
       "_80%~_            1.0   1.0      1.0     19.0"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x={\"Chinese\":a,\"Math\":b,\"English\":c,\"physics\":d}\n",
    "Achievement_analysis_report=pd.DataFrame(x,index=[\"passing_rate\",\"_<60%_\",\"_60~80%_\",\"_80%~_\"])\n",
    "Achievement_analysis_report"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "64502ea9-c3ba-430c-9478-0c65ac4163e5",
   "metadata": {},
   "source": [
    "### 法二:成绩分析报告"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5a9cba58-29c1-4c93-b36b-6fd9cac669e3",
   "metadata": {},
   "source": [
    "#### 两个统计分析函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "f47f38ac-de29-48eb-b2ad-d787ea10644b",
   "metadata": {},
   "outputs": [],
   "source": [
    "def TJ1(row):\n",
    "    n1=n2=n3=0\n",
    "    for i in range(len(row)):\n",
    "         if row[32219100001+i]<90 :\n",
    "                n1+=1\n",
    "         elif 120>row[32219100001+i]>=90:\n",
    "                n2+=1\n",
    "         else:\n",
    "                n3+=1\n",
    "    n4=(n2+n3)/(n1+n2+n3)*100\n",
    "    return [n1,n2,n3,n4]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "7ae22444-ca6f-4a30-a13c-a4463bff5b29",
   "metadata": {},
   "outputs": [],
   "source": [
    "def TJ2(row):\n",
    "    n1=n2=n3=0\n",
    "    for i in range(len(row)):\n",
    "         if row[32219100001+i]<60:\n",
    "                n1+=1\n",
    "         elif 80>row[32219100001+i]>=60:\n",
    "                n2+=1\n",
    "         else:\n",
    "                n3+=1\n",
    "    n4=(n2+n3)/(n1+n2+n3)*100\n",
    "    return [n1,n2,n3,n4]\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "57a6317e-d350-4697-866c-98114b89ebf2",
   "metadata": {},
   "source": [
    "在Pandas中，row 通常指的是DataFrame中的一行数据。当你使用 .apply() 函数并设置 axis=1 时，Pandas会将每一行作为一个Series对象传递给函数。在这个上下文中，你可以将这个Series对象视为“行”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "5d30a175-c014-4c5c-8741-851e0ee7abf6",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Chinese    3192.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "report_card_sorted1[[\"Chinese\"]].apply(lambda row: row.sum())   ##尝试理解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "03d80523-8421-418f-b4b2-6f5a4557d8c2",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32219100001</th>\n",
       "      <td>87.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100002</th>\n",
       "      <td>63.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100003</th>\n",
       "      <td>54.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100004</th>\n",
       "      <td>111.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100005</th>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100006</th>\n",
       "      <td>75.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100007</th>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100008</th>\n",
       "      <td>71.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100009</th>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100010</th>\n",
       "      <td>109.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100011</th>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100012</th>\n",
       "      <td>46.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100013</th>\n",
       "      <td>54.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100014</th>\n",
       "      <td>69.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100015</th>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100016</th>\n",
       "      <td>49.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100017</th>\n",
       "      <td>95.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100018</th>\n",
       "      <td>69.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100019</th>\n",
       "      <td>102.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100020</th>\n",
       "      <td>98.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100021</th>\n",
       "      <td>77.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100022</th>\n",
       "      <td>97.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100023</th>\n",
       "      <td>61.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100024</th>\n",
       "      <td>103.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100025</th>\n",
       "      <td>121.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100026</th>\n",
       "      <td>61.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100027</th>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100028</th>\n",
       "      <td>97.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100029</th>\n",
       "      <td>77.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100030</th>\n",
       "      <td>99.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100031</th>\n",
       "      <td>87.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100032</th>\n",
       "      <td>67.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100033</th>\n",
       "      <td>56.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100034</th>\n",
       "      <td>99.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100035</th>\n",
       "      <td>77.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100036</th>\n",
       "      <td>90.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100037</th>\n",
       "      <td>107.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100038</th>\n",
       "      <td>87.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100039</th>\n",
       "      <td>85.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32219100040</th>\n",
       "      <td>99.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Chinese\n",
       "32219100001     87.0\n",
       "32219100002     63.0\n",
       "32219100003     54.0\n",
       "32219100004    111.0\n",
       "32219100005     60.0\n",
       "32219100006     75.0\n",
       "32219100007     68.0\n",
       "32219100008     71.0\n",
       "32219100009     65.0\n",
       "32219100010    109.0\n",
       "32219100011     76.0\n",
       "32219100012     46.0\n",
       "32219100013     54.0\n",
       "32219100014     69.0\n",
       "32219100015     74.0\n",
       "32219100016     49.0\n",
       "32219100017     95.0\n",
       "32219100018     69.0\n",
       "32219100019    102.0\n",
       "32219100020     98.0\n",
       "32219100021     77.0\n",
       "32219100022     97.0\n",
       "32219100023     61.0\n",
       "32219100024    103.0\n",
       "32219100025    121.0\n",
       "32219100026     61.0\n",
       "32219100027     50.0\n",
       "32219100028     97.0\n",
       "32219100029     77.0\n",
       "32219100030     99.0\n",
       "32219100031     87.0\n",
       "32219100032     67.0\n",
       "32219100033     56.0\n",
       "32219100034     99.0\n",
       "32219100035     77.0\n",
       "32219100036     90.0\n",
       "32219100037    107.0\n",
       "32219100038     87.0\n",
       "32219100039     85.0\n",
       "32219100040     99.0"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "report_card_sorted1[[\"Chinese\"]]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "341d5edb-8f93-41f5-a779-3f96e6584e7b",
   "metadata": {},
   "source": [
    "#### 分析代码及赋值准备："
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d453d95a-5ca7-4b6d-b3fd-c2bcf13243be",
   "metadata": {},
   "source": [
    "##### 第1步"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "c36a120e-be53-4324-8f49-8f0f85bf4d59",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "report_card_sorted1[[\"Chinese\"]].apply(TJ1)\n",
    "type(report_card_sorted1[[\"Chinese\"]].apply(TJ1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "e673196f-871a-45fa-99d3-a2187b5aadd1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>26.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>34.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>13.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>35.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Chinese  Math  English\n",
       "0     26.0  34.0     34.0\n",
       "1     13.0   5.0      5.0\n",
       "2      1.0   1.0      1.0\n",
       "3     35.0  15.0     15.0"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=report_card_sorted1[[\"Chinese\",\"Math\",\"English\"]].apply(TJ1)\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "5df4b775-c100-4afd-85f0-440564977168",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[26., 34., 34.],\n",
       "       [13.,  5.,  5.],\n",
       "       [ 1.,  1.,  1.],\n",
       "       [35., 15., 15.]])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a1=np.zeros((4,3),dtype=float)\n",
    "for i in range(3):\n",
    "    x=\"\"\n",
    "    if i==0:\n",
    "        x=\"Chinese\"\n",
    "    elif i==1:\n",
    "        x=\"Math\"\n",
    "    else:\n",
    "        x=\"English\"\n",
    "    for j in range(a.shape[0]):\n",
    "        a1[j,i]=a.loc[j][x]   \n",
    "a1"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "887c6c84-5ca9-4f34-b283-7e49430995e0",
   "metadata": {},
   "source": [
    "##### 第2步"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "dea764ce-fc76-4f97-8509-defdefc09b14",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>physics</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>97.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   physics\n",
       "0      1.0\n",
       "1     20.0\n",
       "2     19.0\n",
       "3     97.5"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "report_card_sorted1[[\"physics\"]].apply(TJ2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "7416496e-63d5-459c-8c8a-42ffb9affbbd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1.0, 20.0, 19.0, 97.5]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b=report_card_sorted1[[\"physics\"]].apply(TJ2)\n",
    "b1=[]\n",
    "for i in range(b.shape[0]):\n",
    "     b1.append(b.loc[i][\"physics\"])\n",
    "b1"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4ae59ae5-7122-4433-9895-a204533b7347",
   "metadata": {},
   "source": [
    "#### 分析报告输出："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "72fc4059-7cc1-4b14-9efb-3a9348a74766",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "      <th>physics</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>_&lt;60%_</th>\n",
       "      <td>26.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_60~80%_</th>\n",
       "      <td>13.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_80%~_</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>passing_rate</th>\n",
       "      <td>35.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>97.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              Chinese  Math  English  physics\n",
       "_<60%_           26.0  34.0     34.0      1.0\n",
       "_60~80%_         13.0   5.0      5.0     20.0\n",
       "_80%~_            1.0   1.0      1.0     19.0\n",
       "passing_rate     35.0  15.0     15.0     97.5"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1={\"Chinese\":[0,0,0,0],\"Math\":[0,0,0,0],\"English\":[0,0,0,0],\"physics\":[0,0,0,0]}\n",
    "Achievement_analysis_report1=pd.DataFrame(x1,index=[\"_<60%_\",\"_60~80%_\",\"_80%~_\",\"passing_rate\"])\n",
    "Achievement_analysis_report1[[\"Chinese\",\"Math\",\"English\"]] =a1\n",
    "Achievement_analysis_report1[\"physics\"] =b1\n",
    "Achievement_analysis_report1.to_csv(\"Achievement_analysis_report1.csv\")\n",
    "Achievement_analysis_report1"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "06f6f64d-2152-47d5-af90-446c7bd8ddfb",
   "metadata": {},
   "source": [
    "####  *试验："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "54a63ee9-60a2-483f-b041-837305bf9778",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "      <th>physics</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>_&lt;60%_</th>\n",
       "      <td>1</td>\n",
       "      <td>34.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_60~80%_</th>\n",
       "      <td>2</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_80%~_</th>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>passing_rate</th>\n",
       "      <td>4</td>\n",
       "      <td>15.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>97.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              Chinese  Math  English  physics\n",
       "_<60%_              1  34.0     34.0      1.0\n",
       "_60~80%_            2   5.0      5.0     20.0\n",
       "_80%~_              3   1.0      1.0     19.0\n",
       "passing_rate        4  15.0     15.0     97.5"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Achievement_analysis_report1[\"Chinese\"]=[1,2,3,4]\n",
    "Achievement_analysis_report1  #对有序数据直接赋值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "94c50b30-8951-4f12-b5f4-a6d85d54e07f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Chinese</th>\n",
       "      <th>Math</th>\n",
       "      <th>English</th>\n",
       "      <th>physics</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>_&lt;60%_</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_60~80%_</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>_80%~_</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>19.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>passing_rate</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>97.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              Chinese  Math  English  physics\n",
       "_<60%_              1     2        3      1.0\n",
       "_60~80%_            1     2        3     20.0\n",
       "_80%~_              1     2        3     19.0\n",
       "passing_rate        1     2        3     97.5"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Achievement_analysis_report1[[\"Chinese\",\"Math\",\"English\"]]=[[1,2,3],[1,2,3],[1,2,3],[1,2,3]]\n",
    "Achievement_analysis_report1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "20df77a4-f810-42cc-87db-9bb7c86e5b51",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fa1f4497-d2e5-4620-bb96-9c216404f986",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
